namespace Yaaf.WP7.NativeAccess.Helper
{
    using System;
    using System.Diagnostics;

    using Microsoft.Phone.InteropServices;

    public static class InteropHelper
    {
        public static void RegisterDll(string dllname, string guid)
        {
            var hr = ComBridge.RegisterComDll(dllname, new Guid(guid));
            if (hr != 0)
            {
                var message = string.Format("Register COM Dll Failed! hr: {2} ({0}=>{1})", guid, dllname, hr);
                Debug.WriteLine(message);
                // if (Debugger.IsAttached) Debugger.Break();
                throw new RegisterComException(message);
            }
        }
    }
}